package painting

import (
	"gxcvu-ai/app/model"
	"gxcvu-ai/pkg/database"
)

type Painting struct {
	model.BaseModal

	UserID         uint   `json:"user_id,omitempty"`
	Prompt         string `json:"prompt,omitempty"`
	NegativePrompt uint   `json:"negative_prompt,omitempty"`
	Style          string `json:"style,omitempty"`
	Size           string `json:"size,omitempty"`
	TaskId         string `json:"task_id,omitempty"`
	ImageUrl       string `json:"image_url,omitempty"`

	model.CommonTimestampsField
}

func CreatePainting(data Painting) Painting {
	database.DB.Create(&data)
	return data
}

func GetPainting(idstr string) (Painting, error) {
	var painting Painting
	err := database.DB.First(&painting, idstr).Error
	return painting, err
}
